package com.mp.controller;

import com.mp.domain.response.WelcomeVo;
import com.mp.service.MediaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/v1/new/path")
public class WelcomeController {

    @Autowired
    private MediaService mediaService;

    /***
     *
     * @param uuid
     * @return
     */
    @PostMapping("welcome")
    @ResponseBody
    public WelcomeVo getWelcomeIndex(@RequestParam("uuid") String uuid) {
        return mediaService.getWelcomeInformation(uuid);
    }

    /***
     *
     * @param uuid
     * @return
     */
    @PostMapping("thanks")
    @ResponseBody
    public WelcomeVo getEndIndex(@RequestParam("uuid") String uuid) {
        return mediaService.doTransaction(uuid);
    }

    /***
     *
     * @param id
     * @return
     */
    @PostMapping("query")
    @ResponseBody
    public WelcomeVo queryInfo(@RequestParam("id") Long id) {
        return mediaService.queryInfoById(id);
    }
}
